package com.imddysc.jzknavigator.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.imddysc.jzknavigator.utils.ZknaviUtils;

@Controller
public class ZknavigatorCreateController {
	
	private static final Logger logger = LoggerFactory.getLogger(ZknavigatorCreateController.class);
	
	@RequestMapping(value = "/create/{path}")
	public ModelAndView create(@PathVariable("path") String path) {
		ModelAndView mav = new ModelAndView();
		logger.info("create: " + path);
		Map pahtMap = ZknaviUtils.pathHref(path);
		mav.addObject("pathOldUrl",pahtMap.get("pathOldUrl"));
		mav.addObject("pathUrl",pahtMap.get("pathUrl"));
		
		
		
		mav.setViewName("create");
		return mav;
	}

}
